package org.cjstudio.messageboard;

import java.io.IOException;
import javax.servlet.http.*;

@SuppressWarnings("serial")
public class HttpMethodTestServlet extends HttpServlet {

	// HTTP POST - mapped with Create
	public void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/plain");
		resp.getWriter().println("doPost: ");
		resp.getWriter().println("Hello, world");
	}

	// HTTP GET - mapped with Retrieve
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/plain");
		resp.getWriter().println("doGet: ");
		resp.getWriter().println("Hello, world");
	}

	// HTTP PUT - mapped with Update
	public void doPut(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/plain");
		resp.getWriter().println("doPut: ");
		resp.getWriter().println("Hello, world");
	}

	// HTTP DELETE - mapped with Delete
	public void doDelete(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		resp.setContentType("text/plain");
		resp.getWriter().println("doDelete: ");
		resp.getWriter().println("Hello, world");
	}
}
